package Interface;

public class InterfaceTest {
	public static void main(String[] args) {
		BasketBallPlayer bbp = new BasketBallPlayer();
		bbp.name = "张三";
		bbp.age = 29;
		bbp.gender  = "男";
		bbp.sleep();
		bbp.study();
		bbp.speak();
		System.out.println("--------------");
		
		TableTennisCoach ttc = new TableTennisCoach();
		ttc.name = "刘胖子";
		ttc.age = 40;
		ttc.gender = "男";
		ttc.sleep();
		ttc.teach();
	}
}

class Person {
	String name;
	int age;
	String gender;
	
	public Person() {
		
	}
	
	public Person(String name,int age,String gender) {
		this.name = name;
		this.age = age;
		this.gender = gender;
	}
	
	public void eat() {
		System.out.println("吃饭");
	}
	
	public void sleep() {
		System.out.println("睡觉");
	}
}

interface SpeakEnglish {
	public abstract void speak();
}

//运动员
abstract class Player extends Person {
	public abstract void study();
}

//教练
abstract class Coach extends Person {
	public abstract void teach();
}

//篮球运动员
class BasketBallPlayer extends Player implements SpeakEnglish {

	@Override
	public void study() {
		// TODO Auto-generated method stub
		System.out.println("学扣篮");
	}

	@Override
	public void speak() {
		// TODO Auto-generated method stub
		System.out.println("说英语");
	}
	
}
//乒乓球运动员
class TableTennis extends Player {

	@Override
	public void study() {
		// TODO Auto-generated method stub
		System.out.println("学习抽球 ");
	}
	
}

class BasketBallCoach extends Coach implements SpeakEnglish{

	@Override
	public void teach() {
		// TODO Auto-generated method stub
		System.out.println("教扣篮");
	}

	@Override
	public void speak() {
		// TODO Auto-generated method stub
		System.out.println("说英语");
	}
	
}

class TableTennisCoach extends Coach {

	@Override
	public void teach() {
		// TODO Auto-generated method stub
		System.out.println("教抽球");
	}
	
}
